home *** CD-ROM | disk | FTP | other *** search
Text File | 1996-05-21 | 1.6 KB | 52 lines | [TEXT/ttxt] |
- in module DemoModule
-
- --*******************************************************************************
- --* Class name: RolloverButton
- --*
- --* Inherits from: TwoDShape, Button and Rollover
- --* Class type: Concrete
- --* Component: User Interface
- --*
- --* Description: This class is an example of how to mix in the Button class
- --* the Rollover class with a TwoDShape to produce a button that
- --* responds when the mouse enters or leaves its boundary.
- --*
- --* Usage: rb := new RolloverButton enterBitmap:<some bitmap> \
- --* exitBitmap:<some bitmap> \
- --* releasedBitmap:<same bitmap as exitBitmap> \
- --* pressedBitmap:<some bitmap>
- --*
- --* IVs:
- --*
- --* Methods: setPressedAppearance
- --* setReleasedAppearance
- --*
- --* Required files: button.sx
- --* rollover.sx
- --*
- --* Notes: When using the Rollover class with the Button class, since
- --* the exit appearance and released appearance is the same,
- --* just set the releasedBitmap IV and exitBitmap IV to the same
- --* bitmap.
- --*
- --* Author: Su Quek - Kaleida Labs, Inc.
- --*******************************************************************************
- class RolloverButton (TwoDShape, Button, Rollover)
- end
-
- -- The following methods are specialized to produce custom appearances.
- -- In this example, when the button is pressed, a red stroke appears around
- -- the bitmap.
-
- method setPressedAppearance self {class RolloverButton} ->
- (
- nextmethod self
- self.stroke := (new Brush color:redColor)
- )
-
- method setReleasedAppearance self {class RolloverButton} ->
- (
- nextmethod self
- self.stroke := undefined
- )
-